<?php
namespace App\Http\Middleware;
use Closure;

/**
 * Class Auth
 * @package App\Http\Middleware
 */
class Auth
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if(!$request->session()->has('admin')){

            return redirect("/login/");
            die;
        }
        return $next($request);
    }
}